<script setup>
import { RouterView } from 'vue-router'
</script>

<template>
  <div class="app-bg">
    <header class="header-bar">
      <div class="header-left">
        <div class="brand">
          <span class="brand-icon">💻</span>
          <span class="brand-text">前端面试助手</span>
        </div>
      </div>
      <nav class="nav-btns">
        <router-link to="/interview" class="nav-btn" active-class="active">
          <el-icon><Document /></el-icon>
          <span>面试题集</span>
        </router-link>
        <router-link to="/resume" class="nav-btn" active-class="active">
          <el-icon><Files /></el-icon>
          <span>简历编辑器</span>
        </router-link>
        <router-link to="/exam" class="nav-btn" active-class="active">
          <el-icon><Edit /></el-icon>
          <span>考试系统</span>
        </router-link>
        <router-link to="/plan" class="nav-btn" active-class="active">
          <el-icon><Calendar /></el-icon>
          <span>计划管理</span>
        </router-link>
      </nav>
      <div class="header-right">
        <el-button class="theme-toggle" text>
          <el-icon><Moon /></el-icon>
        </el-button>
      </div>
    </header>
    <main class="main-content">
      <RouterView />
    </main>
  </div>
</template>

<style>
html, body, #app, .app-bg {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: #f6f8fb;
}

.app-bg {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
}

.header-bar {
  width: 100%;
  height: 64px;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  margin-right: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 24px;
}

.brand-text {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.nav-btns {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.nav-btn.active {
  background: #2563eb;
  color: #fff;
}

.nav-btn .el-icon {
  font-size: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  padding: 8px;
  border-radius: 8px;
  color: #4b5563;
}

.theme-toggle:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.main-content {
  flex: 1;
  margin-top: 64px;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .header-bar {
    padding: 0 16px;
  }

  .brand-text {
    display: none;
  }

  .nav-btns {
    margin: 0 12px;
  }

  .nav-btn span {
    display: none;
  }

  .nav-btn {
    padding: 8px;
  }

  .main-content {
    padding: 16px;
  }
}
</style>
